package tongkeyon.construct.adapter.type2;

import tongkeyon.construct.adapter.type1.Destination;
import tongkeyon.construct.adapter.type1.Source220V;

/**
 * @Author: keyon <tongkeyon@163.com>
 * @Date: 2020/2/25 10:51
 * @Version 1.0
 */

/**
 * 对象适配器模式，将继承的实现改为依赖的实现，可以降低耦合性
 */
public class ObjectAdapter  implements Destination {
    private Source220V source220V=new Source220V();

    @Override
    public void receive() {
        int provide = source220V.provide();
        System.out.println(provide);
    }
}
